using UnityEngine;

public class ProjectileObject : MonoBehaviour
{
	public GameObject gameObjectForContact;

	private bool isActived;

	private void OnTriggerEnter2D(Collider2D collision)
	{
		if (!isActived && !collision.CompareTag("PlayerRestrictedArea") && collision.CompareTag("Body") && collision.TryGetComponent<BodyPart>(out var component))
		{
			isActived = true;
			Object.Instantiate(gameObjectForContact, component.body.transform.position - component.body.transform.right, Quaternion.identity).SetActive(value: true);
			Object.Destroy(base.gameObject);
		}
	}
}
